#ifndef _SEGMENT
#define _SEGMENT

#include <cv.h>
#include <highgui.h>
#include <string>

using namespace cv;

class Segment {
    Mat data;
    string name;
    bool rotation;
    short flip;
    float scale;
    int x;
    int y;
    int ox;
    int oy;
public:
    Segment() : data(), rotation(false), flip(0), scale(1.0f), x(), y(), ox(), oy() {};
    Segment(const char* filename) : rotation(false), flip(0), scale(1.0f), x(), y(), ox(), oy() { data = imread(filename, CV_LOAD_IMAGE_GRAYSCALE); name = string(filename);}
    Segment(const char* filename, bool, short, float, int, int, int, int);

    Mat getSegment();

    int getX() { return x; }
    int getY() { return y; }
    int getOX() { return ox; }
    int getOY() { return oy; }
    int getWidth();
    int getHeight();
    string getName() { return name; }

    void setX(int _x) { x = _x; }
    void setY(int _y) { y = _y; }

    void setOX(int _ox) { ox = _ox; }
    void setOY(int _oy) { oy = _oy; }

    void setFlip(short _flip) { flip = _flip; }
    void setRotation(bool _rotation) { rotation = _rotation; }
    void setScale(float _scale) { scale = _scale; }

    void showSegment(); // for debugging purposes
};

#endif
